#ifndef  _CDTIME_H_
#define _CDTIME_H_

#include "cocos2d.h"

using namespace cocos2d;
 
class CCDTime
{
private:
	unsigned long	m_Limit;
	unsigned long	m_LastTime;
	bool m_Active;
	int m_Id ;
	
public:
	CCDTime();
	~CCDTime();

	int     ID(){return m_Id;}

	void	SetLimit( unsigned long limit ){ m_Limit = limit; }

	void    SetLimit( int limit ){ m_Limit = limit * 1000; }

	void	Run();

	bool	IsFinish();

	float	GetPersent( void );

	void	ReSet();

	void	ReStart();

	void    SetCanUse( void );

	void	FixLastPauseTime(unsigned long dt);

	void    SetActive(bool bActive);

	bool    IsActive(){return m_Active;}
};

#endif